﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Task1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please input year and years count: ");
            //Console.WriteLine(daysOfYear(ReadIntFromConsole()));
            PrintLibYears(ReadIntFromConsole(), ReadIntFromConsole());
            
        }

        static void FridaysToEndOfYear()
        {
            DateTime date = DateTime.Today;
            int nextYear = DateTime.Today.Year + 1;
            while (date.Year != nextYear)
            {
                if (date.DayOfWeek.ToString() == "Friday")
                {
                    Console.WriteLine(date.ToString("dd MMMM"));
                    //Console.WriteLine(date.DayOfWeek.ToString());
                }
                date = date.AddDays(1);
            }
        }

        static int daysOfYear(int Year)
        {
            DateTime date = new DateTime(Year, 1, 1);
            return (date.AddYears(1) - date).Days;
        }

        static void PrintLibYears(int Year, int yearCnt)
        {
            bool flag = false;
            while (!flag)
            {
                if (daysOfYear(Year) == 366)
                {
                    Console.WriteLine("{0} Lib years: ", yearCnt);
                    for (int j = 0; j < yearCnt; j++)
                    {
                        Console.WriteLine("{0} ", Year);
                        Year += 4;
                        flag = true;
                    }
                }
                Year++;
            }
        }

        static int ReadIntFromConsole()
        {
            int number = 0;
            bool flag = false;
            while (!flag)
            {
                try
                {
                    number = Int32.Parse(Console.ReadLine());
                    flag = true;
                }
                catch
                {
                    flag = false;
                }
            }
            return number;
        }
    }
}
